/**
 * Copyright 2007-2008. Chongqing First Information & Network Co., Ltd. All
 * rights reserved. <a>http://www.cqfirst.com.cn</a>
 */
package com.cqcis.uip.base.framework.codec;

import com.cqcis.uip.base.framework.utils.ByteBuffer;

/**
 * 对象编码.
 * 该接口的实现必须为线程安全.
 * 
 * @author huangmy
 * @date   2007-12-20
 */
public interface ObjectEncoder {
	/**
	 * 将message对象编码成ByteBuffer, 如果出错抛出异常. 返回null, 结果将被忽略
	 * @param message
	 * @return
	 */
	public ByteBuffer encode(Object message) throws Exception;
}
